﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="list.aspx.cs" Inherits="He.Web.manage.category.list" %>

<%@ Register Src="../_uc/head_list.ascx" TagPrefix="uc" TagName="head_list" %>
<%@ Register Src="../_uc/head.ascx" TagPrefix="uc" TagName="head" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>类别管理</title>
    <uc:head runat="server" ID="uchead" />
    <uc:head_list runat="server" ID="uchead_list" />
    <script type="text/javascript">
        $(function () {
            //点击激活输入框
            $(".title_td").attr("title", "双击修改");
            $(".title_td").bind("dblclick", function () {
                if (editing == false) {
                    var thisdiv = $(this).find("div");
                    var thisid = thisdiv.attr("id");
                    var txt = $.trim(thisdiv.html());
                    thisdiv.html("<input type='text' value='" + txt + "' tid='" + thisid + "' class='title'  onblur='save_category_title(this,<%=channel_id %>)'/>");
                    $(".title").focus();
                    editing = true;
                }
            });
        });
    </script>
</head>
<body style="padding: 10px;">
    <form id="form1" runat="server">
    <div class="navigation">
        <span class="add"><a href='batch.aspx?channel_id=<%=channel_id%>&parentId=0'>批量增加顶级类别</a></span><span
            class="add"><a href='edit.aspx?action=<%=He.Web.UI.Enums.ActionEnum.Add %>&channel_id=<%=channel_id%>&parentId=0'>
                增加顶级类别</a></span> <b>您当前的位置：首页 &gt;
                    <%=channel.title %>&gt;类别列表</b>
    </div>
    <div class="spClear">
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">
        <asp:Repeater ID="rptList" runat="server" OnItemDataBound="rptList_ItemDataBound">
            <HeaderTemplate>
                <tr>
                    <th width="7%">
                        编号
                    </th>
                    <th>
                        类别名称
                    </th>
                    <th width="90">
                        排序
                    </th>
                    <th width="250">
                        管理操作
                    </th>
                </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:Label ID="lb_id" runat="server" Text='<%#Eval("id")%>'></asp:Label>
                    </td>
                    <td class="title_td">
                        <asp:Literal ID="LitFirst" runat="server"></asp:Literal>
                        <asp:HiddenField ID="txtcategory_id" runat="server" Value='<%#Eval("id") %>' />
                        <asp:HiddenField ID="txtlayer" runat="server" Value='<%#Eval("layer") %>' />
                        <div id="<%#Eval("id") %>" style="display:inline"><%#Eval("title") %></div>
                    </td>
                    <td>
                        <asp:TextBox ID="txtSortId" runat="server" Text='<%#Eval("sort_id")%>' CssClass="txtInput2 small2"
                            onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));" />
                    </td>
                    <td>
                        <span>
                            <%#echoAddSub(Eval("layer"), Eval("id"), channel_id)%></span> <span><a href='edit.aspx?action=<%=He.Web.UI.Enums.ActionEnum.Edit %>&id=<%#Eval("Id") %>'>
                                修改</a></span> <span>
                                    <asp:LinkButton ID="Del" runat="server" OnCommand="Del_Command" CommandArgument='<%#Eval("id") %>'
                                        OnClientClick="return confirm('该操作会删除本类别和下属类别，确定要删除吗？');">删除</asp:LinkButton></span>
                        <span><a href="../<%=channel.manage_url %>/list.aspx?channel_id=<%=channel_id %>&category_id=<%#Eval("id") %>">
                            管理内容</a></span>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>
    <div class="spClear">
    </div>
    <div style="line-height: 30px; height: 30px;">
        <div class="left">
            <span class="btn_bg">
                <asp:LinkButton ID="lbtnSave" runat="server" OnClick="lbtnSave_Click">保存排序</asp:LinkButton></span>
        </div>
    </div>
    </form>
</body>
</html>
